package com.company.day2;
import java.util.Scanner;
/*(几何:判断点是否在矩形内?）
输人点(x，y)，然后检测该点是否在以原点(0，0)为中心、宽为10、高为5的矩形中。例如:(2,2)在矩形内，而(6,4)在矩形外。*/
public class PointJudge {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.printf("Enter a point with two coordinates: ");
        double x = input.nextDouble();
        double y = input.nextDouble();
        if(Math.abs(x) <= 5 && Math.abs(y) <= 2.5){
            System.out.printf(" Point (" + x + "," + y + ") is in the rectangle");
        }else {
            System.out.printf(" Point (" + x + "," + y + ") is not in the rectangle");
        }
    }
}
